package com.kjtpay.design_pattern.simple_factory;

class OperationFactory {
    public static Operation createOperation(String operate) {
        Operation operation = null;
        switch (operate) {
            case "+" :
                operation = new OperationAdd();
                break;
            case "-" :
                operation = new OperationSub();
                break;
            case "*" :
                operation = new OperationMultiply();
                break;
            case "/" :
                operation = new OperationDivide();
                break;
            default:
                break;
        }
        return operation;
    }
}
